clear all
set maxvar 30000
version 14
capture log close
set more off

****************************************************************************************************
* -----   Customize the paths and options:   ----- 
****************************************************************************************************
*cd  "Data\"
global MY_IN_PATH   "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat\data"
global MY_OUT_PATH  "C:\Users\benjamin.balsmeier\Dropbox\Research\REStat"
*global MY_TEMP_PATH "..."

global MY_OUT_FILE  ${MY_OUT_PATH}out.dta
global MY_LOG_FILE  ${MY_OUT_PATH}cr_t5.log

log using "${MY_LOG_FILE}", text replace
****************************************************************************************************
* import CS data
*************************************************************************************************

use ${MY_IN_PATH}/inv.dta, clear
xi: reghdfe inew5 l1lrd_def l1lsale_def l1lemp l1lppe_def l1output, absorb(gvkey) cluster(sic)  
estimates store a
xi: reghdfe inew5 l1lrd_def l1lsale_def l1lemp l1lppe_def l1output, absorb(year gvkey) cluster(sic)  
estimates store b
xi: reghdfe ifnew5 l1lrd_def  l1lsale_def l1lemp l1lppe_def l1output, absorb(gvkey) cluster(sic)  
estimates store c
xi: reghdfe ifnew5 l1lrd_def  l1lsale_def l1lemp l1lppe_def l1output, absorb(gvkey year) cluster(sic)  
estimates store d
					
esttab a b c d,	starlevels(* 0.10 ** 0.05 *** 0.01) stats(N r2) ///
					keep (l1output)  compress 	
